﻿namespace Engine.SpringConfig
{
    using Engine.Managers;
    using Spring.Context.Attributes;
    using Spring.Objects.Factory.Support;

    [Configuration]
    [Scope(ObjectScope.Request)]
    public class EngineSpringConfig
    {
        [Definition]
        [Lazy(true)]
        public virtual IWebClientAdapter FinalWebClientAdapter()
        {
            WebClientAdapter webClientAdapter = new WebClientAdapter();

            return webClientAdapter;
        }

        [Definition]
        [Lazy(true)]
        public virtual IYahooServiceRequestor FinalYahooServiceRequestor()
        {
            YahooServiceRequestor yahooServiceRequestor = new YahooServiceRequestor();
            yahooServiceRequestor.WebClientManager = this.FinalWebClientAdapter();

            return yahooServiceRequestor;
        }
    }
}
